package com.zhs.gccs.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * 缓存一些全局变量
 */
public class CacheUtils {
    public static CacheUtils cacheUtils;
    private CacheUtils(){

    }
    public static CacheUtils getInstance(){
        if(cacheUtils == null){
            synchronized (CacheUtils.class){
                cacheUtils = new CacheUtils();
            }
        }
        return cacheUtils;
    }

    public String pid;

    public String getPid() {
        return pid;
    }

    public synchronized void setPid(String pid) {
        this.pid = pid;
    }

    private List<String> list = new ArrayList<>();

    public synchronized void putPathToList(String path){
        list.add(path);
    }
    public synchronized void removePathFromList(){
        list.remove(0);
    }
    public synchronized int getListSize(){
        return list.size();
    }



}
